package PTA.javaB;

import java.util.Random;
import java.util.Scanner;

public class ex28 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long seed = sc.nextLong();//随机数
        int n = sc.nextInt();
        Random a = new Random(seed);//产生随机数
int count = 0;
for(int i=0;i<n;i++){
    double x=a.nextDouble()*2-1;
    double y = a.nextDouble()*2-1;
    if(Math.pow(x,2)+Math.pow(y,2)<=1){
        count++;
    }
}
        System.out.println(4*(double)count/n);







    }
}
